import req from '@/utils/request'
const baseURL = process.env.VUE_APP_BASE_URL
import qs from 'qs'
export function getTasks(data) {
    return req({
        method: 'get',
        url: baseURL + "/superlink/api/productTask/list?" + qs.stringify(data, { indices: false }),
    })
}

export function delTasks(token) {
    return req({
        method: 'delete',
        url: baseURL + "/superlink/api/productTask/delete/" + token,
    })
}
export function putTasks(data, token) {
    return req({
        method: 'put',
        url: baseURL + "/superlink/api/productTask/update/" + token,
        data
    })
}
export function postTasks(data) {
    return req({
        method: 'post',
        url: baseURL + "/superlink/api/productTask/create",
        data
    })
}
export function exportTasks(params) {
    return req({
        method: 'get',
        url: baseURL + "/superlink/api/productTask/export?" + qs.stringify(params, { indices: false }),
        responseType: 'arraybuffer',
    })
}
export function submitImport(data) {
    return req({
        method: 'post',
        url: baseURL + "/superlink/api/productTask/import?url=" + data.url.slice(4),
    })
}
export function submitTask(data) {
    return req({
        method: 'post',
        url: baseURL + "/superlink/api/productTask/submit",
        data
    })
}
export function getTaskDetails(token) {
    return req({
        method: 'get',
        url: baseURL + "/superlink/api/productTask/byToken/" + token,
    })
}


